package com.nanuminc.market.today.detail;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.nanuminc.market.R;
import com.nanuminc.market.utils.ImageUtil;

/**
 * 
 * @author HYUP
 *
 * 설명 : 서버에서 TodayDetailView에서 
 * 인덱스에 해당하는 이미지한개를 받는다.
 */

public class TodayDetailPopup extends Activity {

	Resources res;
	String imgPos, cmd;
	Context context;
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.todaydetailpopup);
	    
	    context = getApplicationContext();
	    Intent intent = getIntent();
	    // position값을 서버로넘겨주고 cmd 받는다
	    imgPos = intent.getStringExtra("IMGPOS");
    	
	    ImageView popupImg = (ImageView)findViewById(R.id.popupimg);
	    TextView popupText = (TextView)findViewById(R.id.popuptext);

	    ImageUtil imgUtil = new ImageUtil();
	    imgUtil.ApiUrlToBitmap(context, cmd);
	    Bitmap bmp = imgUtil.GetBitmap();
	    //popupImg.setScaleType(ImageView.ScaleType.FIT_XY);  //이미지 틀에 맞추기
	    popupImg.setImageBitmap(bmp);
	    popupText.setText("후후훗 설명글이다");
	}
}
